<?php
/**
 * 缓存键值枚举
 * User: Woozee
 * Date: 2021/1/27
 * Time: 23:13
 */

namespace App\Enum;

use App\Enum\Stock\ContinueTypeEnum;

class CacheKeyEnum extends \App\Libs\Base\BaseEnum
{
    const STOCK_CONTINUE = 'stock_continue';
    const STOCK_GROWTH = 'stock_growth';

    protected const TEXT = [
        self::STOCK_CONTINUE => '持续强势/弱势',
        self::STOCK_GROWTH => '业绩高增长',
    ];

    public static function getContinueKey(int $days, string $startDate, int $type = ContinueTypeEnum::STRONG): string
    {
        return self::STOCK_CONTINUE . "_{$type}_{$days}_{$startDate}";
    }

    public static function getGrowthKey(int $period, string $growth, int $duration, string $year): string
    {
        return self::STOCK_CONTINUE . "{$year}_{$period}_{$growth}_{$growth}";
    }
}
